package edu.whu.assignment8.dataobject;

import lombok.Data;

import java.util.Arrays;
import java.util.List;

@Data
public class Role {
    private String name;
    private String authorities;
    private List<String> authorityList;

    public List<String> getAuthorityList() {
        if(authorities == null || authorities.isEmpty()) {
            return null;
        }
        return Arrays.asList(authorities.split(","));
    }
}
